home *** CD-ROM | disk | FTP | other *** search
- /* Definitions of target machine for GNU compiler. atariST/TT version.
- Copyright (C) 1987, 1988 Free Software Foundation, Inc.
-
- This file is part of GNU CC.
-
- GNU CC is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- GNU CC is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU CC; see the file COPYING. If not, write to
- the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
- /* The following Macros control the compilation
- *
- * CROSSATARI defined when making cross compiler for TOS or Minix
- * MINIX defined when making cross compiler for MINIX only
- * atariminix defined when making compiler for MINIX
- * atarist defined when making compiler for TOS
- */
-
- #include "m68k.h"
-
- #if defined(__GNUC__)
- # if defined(alloca)
- # undef alloca
- # endif
- # define alloca(x) __builtin_alloca(x)
- #endif
-
- #if defined(sparc)
- # if !defined(alloca)
- # include <alloca.h>
- # endif
- #endif
-
- /* See m68k.h. 0 means 68000 with no 68881. */
-
- #define TARGET_DEFAULT 0 /* use this for a regular ST */
- /* #define TARGET_DEFAULT 2 use this for a ST with 68881/82 */
- /* #define TARGET_DEFAULT 5 use this for a TT withOUT 68881/82 */
- /* #define TARGET_DEFAULT 7 use this for a TT with 68881/82 */
- /* #define TARGET_DEFAULT 0407 use this for a Falcon */
- /* may be vaporware but we are ready for it. yeah!! */
- /* USE this for a 68040, when -m68040 is specified. In this
- mode, the 881/2 instructions not on the 040 are not produced
- see TARGET_68040 in m68k.h
- (also note the difference vs TARGET_68040_ONLY) */
-
- /* #define TARGET_DEFAULT 01000 use this for 68040_ONLY, dont know what
- this is useful for */
-
-
- /* These compiler options take an argument. We ignore -target for now. */
-
- #define WORD_SWITCH_TAKES_ARG(STR) \
- (!strcmp (STR, "Tdata") || !strcmp (STR, "include") \
- || !strcmp (STR, "imacros") || !strcmp (STR, "target") \
- || !strcmp (STR, "assert"))
-
- /* -m68040-only requires special flags to assembler */
- /* -m68020 requires special flags to the assembler. */
-
- /* -m68000 (on atari) need this flag to assembler, otherwise pc relative
- code is produced where it should not be (in places where the
- 68000 only allows data ALTERABLE addressing modes) (++jrb 03/19/89) */
-
- #if (TARGET_DEFAULT & 01000)
- /* note atleast gas-1.38 Patchlevel 2 required for mc68040 specific
- support in the assembler.
- */
- #define ASM_SPEC \
- "%{m68000:-mc68000}%{mc68000:-mc68000} \
- %{!mc68000:%{!m68000:\
- %{mc68020:-mc68020}%{m68020:-mc68020} \
- %{!mc68020:%{!m68020:\
- %{mc68040:-mc68020}%{m68040:-mc68020} \
- %{!mc68040:%{!m68040:-mc68040}} \
- }} \
- }}"
- #else
- /* falcon/TT */
- #if (TARGET_DEFAULT & 5) /* note this is true for TARGET_DEFAULT == 0407 too */
- /* for the TT etc (020/030) also appropriate for m68040 (falcon)
- ie: -m68040 (and not -m68040-only). Note that the
- assembler does not need any special indication of the 040
- when -m68040, only needs -mc68020. the only time
- the assembler needs -mc68040 is when -m68040-only
- */
- #define ASM_SPEC \
- "%{m68000:-mc68000}%{mc68000:-mc68000} \
- %{!mc68000:%{!m68000:\
- %{m68040-only:-mc68040}%{mc68040-only:-mc68040} \
- %{!m68040-only:%{!mc68040-only:-mc68020}} \
- }}"
- #else
- /* for a regular 68k ST */
- #define ASM_SPEC \
- "%{m68040-only:-mc68040}%{mc68040-only:-mc68040} \
- %{!m68040-only:%{!mc68040-only:\
- %{m68020:-mc68020}%{mc68020:-mc68020} \
- %{!mc68020:%{!m68020:-mc68000}} \
- }}"
- #endif /* TT /falcon */
- #endif /* m68040-only */
-
- /* Names to predefine in the preprocessor for this target machine. */
-
- #if (defined(MINIX) || defined(atariminix))
- # if (TARGET_DEFAULT & 5)
- # if(TARGET_DEFAULT & 2)
- # define CPP_PREDEFINES "-DATARI_ST -Dminix -Dm68k -DATARI_TT -DM68881"
- # else
- # define CPP_PREDEFINES "-DATARI_ST -Dminix -Dm68k -DATARI_TT"
- # endif
- # else
- # if(TARGET_DEFAULT & 2)
- # define CPP_PREDEFINES "-DATARI_ST -Dminix -Dm68k -DM68881"
- # else
- # define CPP_PREDEFINES "-DATARI_ST -Dminix -Dm68k"
- # endif
- # endif
- #else
- # if (TARGET_DEFAULT & 5)
- # if(TARGET_DEFAULT & 2)
- # define CPP_PREDEFINES "-Datarist -Dgem -Dm68k -Dataritt -DM68881"
- # else
- # define CPP_PREDEFINES "-Datarist -Dgem -Dm68k -Dataritt"
- # endif
- # else
- # if(TARGET_DEFAULT & 2)
- # define CPP_PREDEFINES "-Datarist -Dgem -Dm68k -DM68881"
- # else
- # define CPP_PREDEFINES "-Datarist -Dgem -Dm68k"
- # endif
- # endif
- #endif
-
- #define PTRDIFF_TYPE "long int"
- #define SIZE_TYPE "long unsigned int"
- #undef WCHAR_TYPE
- #undef WCHAR_TYPE_SIZE
- #define WCHAR_TYPE "int"
- #define WCHAR_TYPE_SIZE 32 /* just for building the compiler */
-
- /* default exec dir */
- #ifndef STANDARD_EXEC_PREFIX
- # ifdef MINIX
- # define STANDARD_EXEC_PREFIX CROSSDIR "/lib/gcc-"
- # else
- # ifdef atariminix
- # define STANDARD_EXEC_PREFIX "/usr/local/lib/gcc-"
- # else
- # define STANDARD_EXEC_PREFIX CROSSDIR "/lib/gcc-"
- # endif
- # endif
- #endif
-
- #define STANDARD_STARTFILE_PREFIX ""
- #define EXECUTABLE_SUFFIX ".ttp"
-
- /* Alignment of field after `int : 0' in a structure. */
- /* recent gcc's have this as 16, this is left in for the benfit of */
- /* older gcc */
- #undef EMPTY_FIELD_BOUNDARY
- #define EMPTY_FIELD_BOUNDARY 16
-
- /* Every structure or union's size must be a multiple of 2 bytes. */
-
- #undef STRUCTURE_SIZE_BOUNDARY
- #define STRUCTURE_SIZE_BOUNDARY 16
-
- #define DBX_DEBUGGING_INFO 1
-
- #ifndef HAVE_VPRINTF
- #define HAVE_VPRINTF 1
- #endif
-
- #ifdef abort
- #undef abort
- #define abort fancy_abort
- #endif
-
-
- /* the following stolen from tm-sun3.h, they seem to work better */
- /* This is how to output an assembler line defining a `double' constant. */
-
- /* fake out isinf for !sun for now */
- #ifndef sun
- #define isinf(X) (0)
- #endif
-
- #define double_is_minus_zero(X) ((X) == -0.0)
-
- #undef ASM_OUTPUT_DOUBLE
- #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
- (isinf ((VALUE)) \
- ? fprintf (FILE, "\t.double 0r%s99e999\n", ((VALUE) > 0 ? "" : "-")) \
- : double_is_minus_zero ((VALUE)) \
- ? fprintf (FILE, "\t.long 0x80000000,0\n") \
- : fprintf (FILE, "\t.double 0r%.20e\n", (VALUE)))
-
- /* This is how to output an assembler line defining a `float' constant. */
-
- #undef ASM_OUTPUT_FLOAT
- #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
- (isinf ((VALUE)) \
- ? fprintf (FILE, "\t.single 0r%s99e999\n", ((VALUE) > 0 ? "" : "-")) \
- : double_is_minus_zero ((VALUE)) \
- ? fprintf (FILE, "\t.long 0x80000000\n") \
- : fprintf (FILE, "\t.single 0r%.20e\n", (VALUE)))
-
- #undef ASM_OUTPUT_FLOAT_OPERAND
- #define ASM_OUTPUT_FLOAT_OPERAND(FILE,VALUE) \
- (isinf ((VALUE)) \
- ? fprintf (FILE, "#0r%s99e999", ((VALUE) > 0 ? "" : "-")) \
- : double_is_minus_zero ((VALUE)) \
- ? fprintf (FILE, "#0r-0.0") \
- : fprintf (FILE, "#0r%.9g", (VALUE)))
-
- #undef ASM_OUTPUT_DOUBLE_OPERAND
- #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE) \
- (isinf ((VALUE)) \
- ? fprintf (FILE, "#0r%s99e999", ((VALUE) > 0 ? "" : "-")) \
- : double_is_minus_zero ((VALUE)) \
- ? fprintf (FILE, "#0r-0.0") \
- : fprintf (FILE, "#0r%.20g", (VALUE)))
-
-
- /* specs for start file and link specs */
-
- #ifndef CROSSATARI
-
- #ifdef atariminix
- #define STARTFILE_SPEC \
- "%{pg:/usr/local/lib/gcrtso.o%s}\
- %{!pg:\
- %{p:/usr/local/lib/mcrtso.o%s}\
- %{!p:/usr/local/lib/crtso.o%s}}"
- #else /* atarist */
- #define STARTFILE_SPEC \
- "%{mint:\
- %{pg:$GNULIB$\\mgcrt0.o%s}\
- %{!pg:\
- %{p:$GNULIB$\\mmcrt0.o%s}\
- %{!p:$GNULIB$\\mcrt0.o%s}}}\
- \
- %{!mint:\
- %{pg:$GNULIB$\\gcrt0.o%s}\
- %{!pg:\
- %{p:$GNULIB$\\mcrt0.o%s}\
- %{!p:$GNULIB$\\crt0.o%s}}}"
- #endif
-
- #else /* CROSSATARI */
-
- #ifdef MINIX
- #define STARTFILE_SPEC \
- "%{pg:" CROSSDIR "/lib/gcrtso.o%s}\
- %{!pg:\
- %{p:" CROSSDIR "/lib/mcrtso.o%s}\
- %{!p:" CROSSDIR "/lib/crtso.o%s}}"
- #else
- #define STARTFILE_SPEC \
- "%{mint:\
- %{pg:" CROSSDIR "/lib/mgcrt0.o%s}\
- %{!pg:\
- %{p:" CROSSDIR "/lib/mmcrt0.o%s}\
- %{!p:" CROSSDIR "/lib/mcrt0.o%s}}}\
- \
- %{!mint:\
- %{pg:" CROSSDIR "/lib/gcrt0.o%s}\
- %{!pg:\
- %{p:" CROSSDIR "/lib/mcrt0.o%s}\
- %{!p:" CROSSDIR "/lib/crt0.o%s}}}"
- #endif
- #endif /* CROSSATARI */
-
- /* NOTE: for ataris we dont need to do anything special for -a or -tcov
- as bb_* routines will automatically be pulled in from the libraries
- as required when they are referenced by the generated code.
- */
-
- #ifdef MINIX
- #define LIB_SPEC \
- "%{mshort:" CROSSDIR "/lib/libc.a}\
- %{!mshort:" CROSSDIR "/lib/libc32.a}"
- #else
- #ifdef atariminix
- #define LIB_SPEC \
- "%{mshort:/usr/local/lib/libc.a}\
- %{!mshort:/usr/local/lib/libc32.a}"
- #else /* atarist cross or native */
-
- #ifndef __GPLUSPLUS__
- #define LIB_SPEC \
- "%{mint:\
- %{!gg:\
- %{mshort:-lmint16 -lgnu16}\
- %{!mshort:-lmint -lgnu}}\
- %{gg:\
- %{mshort:-lmintg16 -lgnugdb16}\
- %{!mshort:-lmintg -lgnugdb}}}\
- \
- %{!mint:\
- %{!gg:\
- %{mshort:-lgnu16}\
- %{!mshort:-lgnu}}\
- %{gg:\
- %{mshort:-lgnugdb16}\
- %{!mshort:-lgnugdb}}}"
-
- #else /* atariSt g++ */
-
- #define LIB_SPEC \
- "%{mint:\
- %{!gg:\
- %{mshort:-lmint16 -lg++16 -lgnu16}\
- %{!mshort:-lmint -lg++ -lgnu}}\
- %{gg:\
- %{mshort:-lmintg16 -lg++gdb16 -lgnugdb16}\
- %{!mshort:-lmintg -lg++gdb -lgnugdb}}}\
- \
- %{!mint:\
- %{!gg:\
- %{mshort:-lg++16 -lgnu16}\
- %{!mshort:-lg++ -lgnu}}\
- %{gg:\
- %{mshort:-lg++gdb16 -lgnugdb16}\
- %{!mshort:-lg++gdb -lgnugdb}}}"
- #endif
-
- #endif
- #endif
-
- /* add -mint : meanining
- pre-procees with -D__MINT__
- compile with -mint (target_flags & 02000) (this flag is
- currently not used by cc1, but maybe later)
- link with mcrt0.o and -lmint -lgnu
-
- */
- #undef TARGET_SWITCHES
- #define TARGET_SWITCHES \
- { { "68020", 5}, \
- { "c68020", 5}, \
- { "68881", 2}, \
- { "bitfield", 4}, \
- { "68000", -5}, \
- { "c68000", -5}, \
- { "soft-float", -0102}, \
- { "nobitfield", -4}, \
- { "rtd", 8}, \
- { "nortd", -8}, \
- { "short", 040}, \
- { "noshort", -040}, \
- { "fpa", 0100}, \
- { "nofpa", -0100}, \
- { "sky", 0200}, \
- { "nosky", -0200}, \
- { "68040", 0407}, \
- { "68030", -01400}, \
- { "68030", 7}, \
- { "68040-only", 01000}, \
- { "int", 02000}, \
- { "noint", -02000}, \
- { "", TARGET_DEFAULT}}
-
- #ifdef atarist
- # ifdef ASM_OUTPUT_SOURCE_FILENAME
- # undef ASM_OUTPUT_SOURCE_FILENAME
- # endif
- # define ASM_OUTPUT_SOURCE_FILENAME(file, filename) \
- fprintf (file, "\t.stabs \""); \
- atari_output_filename(file, filename); \
- fprintf(file, "\",%d,0,0,Ltext\n", N_SOL)
- #endif
-
- #ifndef ASM_COMMENT_START
- #define ASM_COMMENT_START " | "
- #endif
-
- /* these two should never be used, #define them here so they are'nt
- in cccp.c
- */
- #define STANDARD_INCLUDE_DIR 8086_sucks
- #define LOCAL_INCLUDE_DIR 80486_sucks
-
- /* all the INCLUDE_DEFAULTS */
- #ifdef CROSSATARI /* TOS or MINIX cross compiler */
- #ifndef SYSTEM_INCLUDE_DIR
- # define SYSTEM_INCLUDE_DIR CROSSINC
- #endif
- #ifndef SYSTEM_GPLUSPLUS_INCLUDE_DIR
- # define SYSTEM_GPLUSPLUS_INCLUDE_DIR GPLUSPLUS_INCLUDE_DIR
- #endif
- #endif
-
- #ifdef atarist /* TOS native compiler */
- #ifndef SYSTEM_INCLUDE_DIR
- # define SYSTEM_INCLUDE_DIR "\\gnu\\lib"
- #endif
- #ifndef SYSTEM_GPLUSPLUS_INCLUDE_DIR
- # define SYSTEM_GPLUSPLUS_INCLUDE_DIR "\\gnu\\g++-inc"
- #endif
- #endif
-
- #ifdef atariminix /* MINIX native compiler */
- #ifndef SYSTEM_INCLUDE_DIR
- # define SYSTEM_INCLUDE_DIR "/usr/local/gcc-include"
- #endif
- #ifndef SYSTEM_GPLUSPLUS_INCLUDE_DIR
- # define SYSTEM_GPLUSPLUS_INCLUDE_DIR "/usr/local/g++-inc"
- #endif
- #endif
-
- #define INCLUDE_DEFAULTS \
- { \
- { SYSTEM_INCLUDE_DIR, 0 }, \
- { SYSTEM_GPLUSPLUS_INCLUDE_DIR, 1 }, \
- { 0, 0 } \
- }
-
- #ifdef atarist
- void atari_output_filename();
- #endif
-
- #ifdef atarist
- #define FILE_NAME_NONDIRECTORY(X) \
- atari_filename_nondirectory(X);
- extern char *atari_filename_nondirectory();
- #endif
-